//
//  FZHomeViewModel.h
//  EnglishTalk
//
//  Created by CyonLeuPro on 15/6/26.
//  Copyright (c) 2015年 Feizhu Tech. All rights reserved.
//

#import <Foundation/Foundation.h>

#import "FZHomeRootModel.h"
#import "FZHomeCollectionViewSectionHeaderView.h"
#import "FZHomeCourseModel.h"

@class FZHomeViewModel;

@protocol FZHomeViewModelDelegate <NSObject>

@optional

- (void)homeViewModelShowLoginViewController:(FZHomeViewModel *)homeViewModel;
- (void)homeViewModel:(FZHomeViewModel *)homeViewModel pushViewController:(UIViewController *)viewController;
- (void)homeViewModel:(FZHomeViewModel *)homeViewModel onChangeHotVideoButton:(UIButton *)button object:(id)object;
- (void)homeViewModel:(FZHomeViewModel *)homeViewModel isEditing:(BOOL)isEditing;
- (void)homeViewModel:(FZHomeViewModel *)homeViewModel showMessage:(NSString *)message;

@end


@interface FZHomeViewModel : NSObject

- (instancetype)initWithCollectionView:(UICollectionView *)collectionView info:(FZHomeRootModel *)rootModel delegate:(id<FZHomeViewModelDelegate>)viewController;

@property (assign, nonatomic) id<FZHomeViewModelDelegate> delegate;
@property (assign, nonatomic) BOOL isEditing;

@property (strong) NSMutableArray *sectionModels;
@property (strong) FZHomeCourseModel *bookModel;

- (void)reloadCurrentBook;
- (void)cleanAllData;//清除所有数据，可用于下拉刷新
- (NSInteger)numberOfSections;
- (NSInteger)numberOfItemsInSection:(NSInteger)section;
- (id)itemForIndexPath:(NSIndexPath *)indexPath;

- (void)didSelectItemForIndexPath:(NSIndexPath *)indexPath;

- (UICollectionViewCell *)cellForItemAtIndexPath:(NSIndexPath *)indexPath;
- (UICollectionReusableView *)viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath;
- (CGSize)sizeForItemAtIndexPath:(NSIndexPath *)indexPath;

- (UIEdgeInsets)insetForSectionAtIndex:(NSInteger)section;
- (CGSize)referenceSizeForHeaderInSection:(NSInteger)section;
- (CGSize)referenceSizeForFooterInSection:(NSInteger)section;


@end
